﻿using JTC.Genetics.Molecules._Interfaces;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace JTC.Genetics.Molecules
{
    public class Chromosomes : IChromosomes
    {
        private List<IChromosome> _list;
        public Chromosomes()
        {
            _list = new List<IChromosome>();
        }

        public void Add(IChromosome item)
        {
            _list.Add(item);
        }

        public void Clear()
        {
            _list.Clear();
        }

        public bool Contains(IChromosome item)
        {
            return _list.Contains(item);
        }

        public void CopyTo(IChromosome[] array, int arrayIndex)
        {
            _list.CopyTo(array, arrayIndex);
        }

        public int Count
        {
            get { return _list.Count; }
        }

        public bool IsReadOnly
        {
            get { return false; }
        }

        public bool Remove(IChromosome item)
        {
            return _list.Remove(item);
        }

        public IEnumerator<IChromosome> GetEnumerator()
        {
            return _list.GetEnumerator();
        }

        System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
        {
            return GetEnumerator();
        }
    }
}
